Skip to content

feat: inform user about cli updates - #91

Merged
aviatco merged 14 commits into
microsoft:mainfrom
Guust-Franssens:feat/inform-about-user-about-cli-updates
Jan 5, 2026
Merged

feat: inform user about cli updates#91
aviatco merged 14 commits into
microsoft:mainfrom
Guust-Franssens:feat/inform-about-user-about-cli-updates

Conversation

@Guust-Franssens

@Guust-Franssens Guust Franssens (Guust-Franssens) commented Dec 11, 2025

Copy link
Copy Markdown
Contributor

📥 Pull Request

✨ Description of new changes

Implements automatic update notifications that inform users when a new version of the Fabric CLI is available on PyPI. The check runs on login (fab auth login) and displays a friendly notification if an update is available.

Changes Made

New Files:

  • src/fabric_cli/utils/fab_version_check.py - Core version checking module with PyPI integration
  • tests/test_utils/test_fab_version_check.py - 100% coverage on fab_version_check.py

Modified Files:

  • src/fabric_cli/core/fab_constant.py - Added constants for update checking configuration
  • src/fabric_cli/commands/auth/fab_auth.py - Integrated version check on successful login
  • docs/essentials/settings.md - Documented the new check_updates setting

Implementation Details

  • Once per session: version check is ran whenever a user logs in using fab auth login
  • User Control: Can be disabled via fab config set check_updates false
  • Silent Failures: Doesn't interrupt user experience if PyPI is unreachable
  • Conservative Version Comparison: Uses tuple-based semantic versioning without external dependencies
  • Debug Logging: Integrated with existing fab_logger for troubleshooting

Configuration

New config key check_cli_version_updates (default: true) stored in ~/.config/fab/config.json. This setting enables/disables update notifications.

User Experience

When a user logs in and a new version is available:

$ fab auth login -u "$CLIENT_ID" -p "$CLIENT_SECRET" --tenant "$TENANT_ID"

[notice] A new release of fab is available: 1.1.0 → 1.2.0
[notice] To update, run: pip install --upgrade ms-fabric-cli

Comment thread src/fabric_cli/core/fab_constant.py Outdated
Comment thread src/fabric_cli/core/fab_constant.py Outdated
Comment thread .changes/unreleased/added-20251211-183425.yaml Outdated
Comment thread src/fabric_cli/utils/fab_version_check.py Outdated
Comment thread tests/test_utils/test_fab_version_check.py Outdated
Comment thread tests/test_utils/test_fab_version_check.py Outdated
Comment thread tests/test_utils/test_fab_version_check.py Outdated
Comment thread tests/test_utils/test_fab_version_check.py Outdated
Comment thread tests/test_utils/test_fab_version_check.py Outdated
@Guust-Franssens

Guust Franssens (Guust-Franssens) commented Dec 23, 2025

Copy link
Copy Markdown
Contributor Author

Thanks for the review aviatco. Your points are valid and I will keep them in mind in my potential future PRs.

I left some of the remarks open (like proper naming and the class one) as these warrant a second review by you to verify if my changes are meeting your request.

@Guust-Franssens

Guust Franssens (Guust-Franssens) commented Dec 24, 2025

Copy link
Copy Markdown
Contributor Author

aviatco Alon Yeshurun (@ayeshurun) in f4b4c4e I made a change to ignore pypi.org in the VCR playback. This was causing issues in the tests/test_commands/test_auth.py.

This passes the tests however now during testing of the fab auth login, actual requests to PyPI are being made. I think it would be cleaner to either:

  • Re-record the requests made to include PyPI (preferable by one of you as I don't have the full setup)
  • I mock the function making the call to PyPI for all tests to auth login. Here I would just make it the mock return value equal to the current __version__

Could you provide some guidance here?

Comment thread src/fabric_cli/commands/auth/fab_auth.py Outdated
Comment thread src/fabric_cli/utils/fab_version_check.py Outdated
Comment thread src/fabric_cli/utils/fab_version_check.py
Comment thread tests/test_utils/test_fab_version_check.py Outdated
@Guust-Franssens
Guust Franssens (Guust-Franssens) force-pushed the feat/inform-about-user-about-cli-updates branch from 14742d2 to e3a65b1 Compare December 30, 2025 07:41
@Guust-Franssens
Guust Franssens (Guust-Franssens) force-pushed the feat/inform-about-user-about-cli-updates branch from 2857200 to b56ef8e Compare December 31, 2025 10:35
Comment thread src/fabric_cli/core/fab_constant.py Outdated
@Guust-Franssens
Guust Franssens (Guust-Franssens) force-pushed the feat/inform-about-user-about-cli-updates branch from a5f498d to b384c46 Compare January 2, 2026 08:15
@aviatco
aviatco merged commit f609cfb into microsoft:main Jan 5, 2026
9 checks passed
@Guust-Franssens
Guust Franssens (Guust-Franssens) deleted the feat/inform-about-user-about-cli-updates branch January 5, 2026 15:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE] Help me keep my fabric-cli updated

3 participants